package com.sun.androidexerciseproject.function.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.sun.androidexerciseproject.function.R;
import com.sun.androidexerciseproject.function.util.LogUtil;

public class SecondActivity extends AppCompatActivity {
    public static void startActivity(Activity activity, int requestCode) {
        activity.startActivityForResult(new Intent(activity, SecondActivity.class), requestCode);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        LogUtil.log("onCreate");

//        Person person = (Person) getIntent().getSerializableExtra(TestConstants.PERSON_KEY);
//        TestLogUtil.log("SecondActivity onCreate person = " + person);
//        startActivityForResult(new Intent(this, ThreeActivity.class), mRequestCode);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        LogUtil.log("onActivityResult SecondActivity requestCode " + requestCode + " resultCode " + resultCode);
        setResult(RESULT_OK);
        finish();
    }

    public void test(View view) {
        smallProgramTest();
    }

    private void smallProgramTest() {
    }
}
